/*
 * @Date: 2023-03-20 19:56:04
 * @LastEditors: Chuying
 * @LastEditTime: 2023-03-27 10:20:10
 * @Description:
 */
import { Entity, PrimaryGeneratedColumn, Column, ManyToMany } from 'typeorm';
import { Posting } from '../../posting/entities/posting.entity';

@Entity()
export class Category {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    name: 'name',
    nullable: false,
  })
  name: string;

  @Column({
    name: 'desc',
    nullable: true,
  })
  desc: string;

  @ManyToMany(() => Posting, (posting) => posting.categories)
  postings: Posting[];
}
